<?php
/** 
 * Copyright (C) 2009 João Neto
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 * @version default - 19/07/2009 - joaoneto
 * @package Expression package is undefined on line 24, column 28 in Templates/Scripting/EmptyPHP_1.
 */
defined('_JEXEC') or die( 'Restricted access' ); //no direct access
/**
 * Default View to Product
 * List all products in the database
 */
$path = dirname( __FILE__ );
?>
<form id="adminForm" action="index.php" method="post">
	<div id="product-tabs">
		<ul class="tabs-nav">
			<li>
				<a href="#product-info"> <?php echo JText::_( 'PRODUCT' ); ?></a>
			</li>
			<li>
				<a href="#types-info"> <?php echo JText::_( 'DESCRIPTION' ); ?></a>
			</li>
			<li>
				<a href="#other-info"> <?php echo JText::_( 'MANUFACTURER_STOCK' ); ?></a>
			</li>
			<li>
				<a href="#other-info"> <?php echo JText::_( 'IMAGES' ); ?></a>
			</li>
			<li>
				<a href="#other-info"> <?php echo JText::_( 'PRICE' ); ?></a>
			</li>
			<li>
				<a href="#other-info"> <?php echo JText::_( 'IMAGES' ); ?></a>
			</li>
			<li>
				<a href="#other-info"> <?php echo JText::_( 'UP-SELL' ); ?></a>
			</li>
			<li>
				<a href="#user-param"> <?php echo JText::_( 'USER_ATTRS' ); ?></a>
			</li>
		</ul>

		<div id="form-lang">
			<?php echo $this->form->render( 'params', 'lang' ); ?>
		</div>
		<div id="product-info">
			<?php require_once $path . DS . 'add' . DS . 'product-info.php'; ?>
		</div>
		<div id="types-info">
			<?php require_once $path . DS . 'add' . DS . 'product-description.php'; ?>
		</div>
		<div id="other-info">
			<?php require_once $path . DS . 'add' . DS . 'product-stock.php'; ?>
		</div>
		<div id="user-param">
			<?php require_once $path . DS . 'add' . DS . 'user-param.php'; ?>
		</div>
	</div>

	<input type="hidden" value="<?php echo $this->_option; ?>" name="option"/>
	<input type="hidden" value="save" name="task"/>
	<input type="hidden" value="product" name="controller"/>
	
	<?php echo JHTML::_( 'form.token' ); ?>
</form>

<script>
	//@override
	function submitbutton( pressbutton )
	{
		if( pressbutton == 'cancel' ){
			window.location.href = '<?php echo JRoute::_( 'index.php?option=com_jloja&controller=frontpage', false ); ?>';
			return;
		}
		$( 'adminForm' ).submit();
	}
</script>